package com.my.study.anno.driven.imports;

import com.my.study.anno.bean.People;
import org.springframework.beans.factory.support.BeanDefinitionRegistry;
import org.springframework.beans.factory.support.RootBeanDefinition;
import org.springframework.context.annotation.ImportBeanDefinitionRegistrar;
import org.springframework.core.type.AnnotationMetadata;

/**
 * @author Carlos
 * @version 1.0
 * @Description TODO
 * @date 2021/11/7 19:57
 **/
public class MyImportBeanDefinitionRegistrar implements ImportBeanDefinitionRegistrar {


    @Override
    public void registerBeanDefinitions(AnnotationMetadata importingClassMetadata, BeanDefinitionRegistry registry) {

        RootBeanDefinition beanDefinition = new RootBeanDefinition(People.class);
        registry.registerBeanDefinition("people", beanDefinition);
    }
}
